package com.liutao.entity;

import java.util.Arrays;
import java.util.Date;
import java.util.List;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

import org.junit.runners.Parameterized.Parameter;
import org.springframework.format.annotation.DateTimeFormat;

import com.liutao.enums.TalentsEnum;
import com.liutao.utils.DateUtil;

public class Talents {
	private Integer id;
	@NotEmpty(message = "姓名不能为空")
	private String taname;
	@DateTimeFormat(pattern = ("yyyy-MM-dd"))
	private Date birthday;
	private TalentsEnum gender;
	@Pattern(regexp = "^1[35789]\\d{9}$",message = "电话号码非法")
	private String phone;
	@NotEmpty(message = "擅长专业不能为空")
	private String specialty;
	@NotEmpty(message = "所属单位不能为空")
	private String institution;
	
	//职称
	private String titleName;
	//迷糊查询职称id
	private Integer tid;
	@NotEmpty(message = "职称不能为空")
	private Integer[] tids;
	//年龄
	private Integer age;
	//快速查询
	private Integer queryType;
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getTaname() {
		return taname;
	}
	public void setTaname(String taname) {
		this.taname = taname;
	}
	public Date getBirthday() {
		return birthday;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
	public TalentsEnum getGender() {
		return gender;
	}
	public void setGender(TalentsEnum gender) {
		this.gender = gender;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getSpecialty() {
		return specialty;
	}
	public void setSpecialty(String specialty) {
		this.specialty = specialty;
	}
	public String getInstitution() {
		return institution;
	}
	public void setInstitution(String institution) {
		this.institution = institution;
	}
	public String getTitleName() {
		return titleName;
	}
	public void setTitleName(String titleName) {
		this.titleName = titleName;
	}
	public Integer getTid() {
		return tid;
	}
	public void setTid(Integer tid) {
		this.tid = tid;
	}
	public Integer[] getTids() {
		return tids;
	}
	public void setTids(Integer[] tids) {
		this.tids = tids;
	}
	public Integer getAge() {
		if(birthday != null) {
			age = DateUtil.getAge(birthday);
		}
		return age;
	}
	public void setAge(Integer age) {
		this.age = age;
	}
	public Integer getQueryType() {
		return queryType;
	}
	public void setQueryType(Integer queryType) {
		this.queryType = queryType;
	}
	public Talents(Integer id, String taname, Date birthday, TalentsEnum gender, String phone, String specialty,
			String institution, String titleName, Integer tid, Integer[] tids, Integer age, Integer queryType) {
		super();
		this.id = id;
		this.taname = taname;
		this.birthday = birthday;
		this.gender = gender;
		this.phone = phone;
		this.specialty = specialty;
		this.institution = institution;
		this.titleName = titleName;
		this.tid = tid;
		this.tids = tids;
		this.age = age;
		this.queryType = queryType;
	}
	public Talents() {
		super();
		// TODO Auto-generated constructor stub
	}
	@Override
	public String toString() {
		return "Talents [id=" + id + ", taname=" + taname + ", birthday=" + birthday + ", gender=" + gender + ", phone="
				+ phone + ", specialty=" + specialty + ", institution=" + institution + ", titleName=" + titleName
				+ ", tid=" + tid + ", tids=" + Arrays.toString(tids) + ", age=" + age + ", queryType=" + queryType
				+ "]";
	}
	
	
	
	
	
	
	
	

}
